package com.kfm.jdbc.day0405;

import java.util.concurrent.BlockingQueue;

public class Make extends Thread{

    BlockingQueue<String> queue;

    public Make(BlockingQueue<String> queue) {
        this.queue = queue;
    }

    @Override
    public void run() {
        while (true){
            try {
                sleep(1000);
                queue.put("面包"); // 会阻塞
                System.out.println("生产了面包");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

    }
}
